package com.nuoniu.sibanyun.mapper.finance;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.finance.InSummary;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 存货总账表 Mapper 接口
 * </p>
 *
 * @author 小啊刚
 * @since 2021-05-26
 */
public interface InSummaryMapper extends BaseMapper<InSummary> {

    /**
     * 根据期间和存货id获取
     * @author 小啊刚
     * @date 2021-07-09
     */
    @Select("select * from fag_summary where account_period=#{accountPeriod} and inventory_id=#{inventoryId} and company_id=#{companyId} and account_year=#{accountYear}")
    InSummary getDetail(Integer accountYear, Integer accountPeriod, Integer inventoryId, Integer companyId);

    /**
     * 获取列表
     * @author 小啊刚
     * @date 2021-07-16
     */
    @Select("select * from fag_summary where inventory_id=#{inventoryId} and company_id=#{companyId} and account_year=#{accountYear}")
    List<InSummary> getSummaryList(Integer inventoryId, Integer companyId, Integer accountYear);
}
